<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );

/**
 * @package Joomla
 * @subpackage Config
 */
class TOOLBAR_JAJOBBOARD {
	
	function _DEFAULT() {
		/*
		 * DEVNOTE: This should make sense by itself now... 
		 */
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ), 'generic.png' );
	}
	
	function JAConfiguration() {
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Configuration' ) );
		JToolBarHelper::save ();
	
	}
	
	function JAApplications() {
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Applications' ) );
		$task = JRequest::getWord ( 'task', '' );
		switch ($task) {
			case 'add' :
			case 'edit' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				}
				break;
			default :
				{
					
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					JToolBarHelper::editList ();
				}
		}
	}
	
	function JAFeeds() {
		JToolBarHelper::title ( JText::_ ( 'JA Job Board Feeds' ), 'generic.png' );
		$task = JRequest::getWord ( 'task', '' );
		switch ($task) {
			case 'add' :
			case 'edit' :
				{
					
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				}
				break;
			default :
				{
					JToolBarHelper::publishList ();
					JToolBarHelper::unpublishList ();
					JToolBarHelper::deleteList ();
					JToolBarHelper::editListX ();
					JToolBarHelper::addNewX ();
				}
				break;
		}
	}
	function JAPaymentConfig() {
		JToolBarHelper::title ( JText::_ ( JText::_ ( 'Payment Config' ), 'generic.png' ) );
		$task = JRequest::getWord ( 'task', '' );
		switch ($task) {
			case 'add' :
				break;
			case 'edit' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				}
				break;
			default :
				{
					JToolBarHelper::unpublishList ();
					JToolBarHelper::publishList ();
					JToolBarHelper::addNew ();
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete them?' ) );
				}
				break;
		}
	}
	
	function JACategories($title) {
		$task = JRequest::getWord ( 'task', '' );
		JToolBarHelper::title ( $title );
		switch ($task) {
			case 'add' :
			case 'edit' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				}
				break;
			case 'show_import' :
				{					
					JToolBarHelper::cancel ();
				}
				break;
			default :
				{					
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete them?' ) );
					JToolBarHelper::editListX ();
					JToolBarHelper::addNewX ();
					JToolBarHelper::custom ( 'show_import', 'upload', '', JText::_ ( 'Import' ), false );
				}
				break;
		}
	
	}
	
	function JASalary() {
		$task = JRequest::getWord ( 'task', '' );
		if ($task != 'add' && $task != 'edit') {
			JToolBarHelper::publishList ();
			JToolBarHelper::unpublishList ();
		}
	}
	
	function JAEmails() {
		$task = JRequest::getWord ( 'task', '' );
		JToolBarHelper::title ( JText::_ ( 'Email Template Manager' ) );
		switch ($task) {
			case 'add' :
			case 'edit' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				}
				break;
			case 'show_duplicate' :
			case 'show_import' :
			case 'show_export' :
				break;
			default :
				{
					JToolBarHelper::custom ( 'show_duplicate', 'copy', '', JText::_ ( 'Copy to' ) );
					JToolBarHelper::custom ( 'show_import', 'upload', '', JText::_ ( 'Import' ), false );
					JToolBarHelper::custom ( 'export', 'restore', '', JText::_ ( 'Export' ) );
					JToolBarHelper::publishList ();
					JToolBarHelper::unpublishList ();
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete them?' ) );
					JToolBarHelper::editListX ();
					JToolBarHelper::addNewX ();
				}
				break;
		}
	}
	
	function JAManagefields() {
		$task = JRequest::getWord ( 'task', '' );
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Fields Form Manager' ) );
		
		switch (strtolower ( $task )) {
			case 'add' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
				}
				break;
			case 'edit' :
				{
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete them?' ), 'drop', JText::_ ( 'Delete' ) );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			case 'updatetable' :
				{
					JToolBarHelper::customX ( 'updateTable', 'assign.png', 'assign_f2.png', 'Continue', false );
					JToolBarHelper::cancel ();
				}
				break;
			default :
				{
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					//				JToolBarHelper::customX('updateTable', 'assign.png', 'assign_f2.png', 'Rebuild DB', false);
					JToolBarHelper::editListX ();
					JToolBarHelper::addNewX ();
				}
				break;
		}
	}
	
	
	function JASearchForms() {
		$task = JRequest::getWord ( 'task', '' );
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Fields Search Form Manager' ) );
		
		switch (strtolower ( $task )) {
			case 'add' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
				}
				break;
			case 'edit' :
				{
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete them?' ), 'drop', JText::_ ( 'Delete' ) );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			
			default :
				{
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					//				JToolBarHelper::customX('updateTable', 'assign.png', 'assign_f2.png', 'Rebuild DB', false);
					JToolBarHelper::editListX ();
					JToolBarHelper::addNewX ();
				}
				break;
		}
	}	
	
	function JAFieldList() {
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Manage Field List' ) );
	
	}
	
	function JAJobs() {
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Job Manager' ) );
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'add' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
				}
				break;
			case 'edit' :
				{
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete them?' ), 'drop', JText::_ ( 'Delete' ) );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			default :
				{
					JToolBarHelper::custom ( 'editList', 'menus', '', 'Edit field list', false );
					JToolBarHelper::customX ( 'non-approved', 'unpublish', '', 'Disapprove', true );
					JToolBarHelper::customX ( 'approved', 'publish', '', 'Approve', true );
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected job(s) will be permanently deleted. Do you want to continue?' ) );
					JToolBarHelper::editList ();
					JToolBarHelper::addNewX ();
				}
		}
	}
	function JAEmployers() {
		
		$task = JRequest::getWord ( 'task', '' );
		$view = JRequest::getWord ( 'view', '' );
		switch (strtolower ( $task )) {
			case 'user' :
				{
					JToolBarHelper::custom ( 'editUser', 'edit', '', 'Edit', false );
					JToolBarHelper::cancel ();
				}
				break;
			case 'resume' :
			case 'profile' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			case 'account' :
				{
					JToolBarHelper::save ( 'employer_save' );
					JToolBarHelper::cancel ();
				}
				break;
			case 'invoices' :
				{
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					
				//				JToolBarHelper::editList('');
				}
				break;
			default :
				{
					JToolBarHelper::custom ( 'sendmail', 'send', '', JText::_ ( 'Send Mail' ), true );
					JToolBarHelper::custom ( 'unapprove', 'unpublish', '', JText::_ ( 'Disapprove' ), true );
					JToolBarHelper::custom ( 'approve', 'publish', '', JText::_ ( 'Approve' ), true );
					if (strtolower ( $view ) == 'jaemployers')
						JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete employer(s)? If so, profile(s) will be deleted, too' ) );
					else
						JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete job-seeker(s)? If so, resume(s) will be deleted, too' ) );
					JToolBarHelper::custom ( 'editUser', 'edit', '', 'Edit', true );
				}
		}
	}
	
	function JAMail() {
		$cid = JRequest::getVar ( 'cid' );
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Mail' ) );
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			
			default :
				{
					JToolBarHelper::preview ( 'index.php?option=com_jajobboard&cid=' . $cid . '&view=jamail&tmpl=component', true );
					JToolBarHelper::custom ( 'send', 'forward', '', 'Send', false );
					JToolBarHelper::cancel ();
				}
		}
	}
	
	function JACandidates() {
		
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'add' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
				}
				break;
			case 'edit' :
				{
					JToolBarHelper::deleteList ( JText::_ ( 'The candidate will be dropped' ), 'drop', JText::_ ( 'Delete' ) );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			default :
				{
					JToolBarHelper::custom ( 'sendmail', 'send', '', 'Send Mail', true );
					JToolBarHelper::custom ( 'editList', 'menus', '', 'Edit List', false );
					JToolBarHelper::unpublishList ( 'unpublish', 'Suspend' );
					JToolBarHelper::publishList ( 'publish', 'Approved' );
					JToolBarHelper::deleteList ( JText::_ ( 'The Employer will be pernantly deleted' ) );
					JToolBarHelper::editList ();
					JToolBarHelper::addNewX ();
				}
		}
	}
	
	function JAPostingPlans_Invoice() {
		$edit = JRequest::getWord ( 'edit', false );
		$layout = JRequest::getWord ( 'layout', '' );
		switch ($layout) {
			case 'form' :
				{
					
					{
						JToolBarHelper::deleteList ( JText::_ ( 'The subscription will be dropped' ), 'drop', JText::_ ( 'Delete' ) );
						JToolBarHelper::cancel ();
					}
				
				}
				break;
			case 'addform' :
				{
					
					JToolBarHelper::save ();
					JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
				}
				break;
			default :
				{
					
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					JToolBarHelper::editList ( 'edit', 'View' );
					JToolBarHelper::addNewX ();
				}
		}
	
	}
	
	function JASubscriptions_Invoice() {
		$edit = JRequest::getWord ( 'edit', false );
		$layout = JRequest::getWord ( 'layout', '' );
		switch ($layout) {
			case 'form' :
				{
					
					{
						JToolBarHelper::deleteList ( JText::_ ( 'The subscription will be dropped' ), 'drop', JText::_ ( 'Delete' ) );
						JToolBarHelper::cancel ();
					}
				
				}
				break;
			case 'addform' :
				{
					
					JToolBarHelper::save ();
					JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
				}
				break;
			default :
				{
					
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					JToolBarHelper::editList ( 'edit', 'View' );
					JToolBarHelper::addNewX ();
				}
		}
	
	}
	
	function JATransactions() {
		$edit = JRequest::getWord ( 'edit', false );
		$layout = JRequest::getWord ( 'layout', '' );
		switch ($layout) {
			case 'form' :
				{
					if ($edit == false) {
						$userid = JRequest::getInt('userid');
						$cid = JRequest::getVar('cid');
						if(is_array($cid)){
							JArrayHelper::toInteger($cid);
							$cid = $cid[0];
						}
						
						
						
						JToolBarHelper::preview ('index.php?option=com_jajobboard&view=jatransactions&layout=trans_detail&userid='.$userid.'&cid[]='.(int)$cid.'&tmpl=component');
						JToolBarHelper::apply ();
						JToolBarHelper::save ();
						
						JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
					} else {
						JToolBarHelper::deleteList ( JText::_ ( 'The transaction will be dropped' ), 'drop', JText::_ ( 'Delete' ) );
						JToolBarHelper::apply ();
						JToolBarHelper::save ();
						JToolBarHelper::cancel ();
					}
				
				}
				break;
			case 'view' :
				JToolBarHelper::cancel ();
				break;
			case 'trans_detail' :
				JToolBarHelper::editList ();
				JToolBarHelper::cancel ();
				break;
			default :
				{
					
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					JToolBarHelper::editList ();
					JToolBarHelper::addNewX ();
				}
		}
	
	}
	
	function JACredits_Invoice() {
		$edit = JRequest::getWord ( 'edit', false );
		$layout = JRequest::getWord ( 'layout', '' );
		switch ($layout) {
			case 'form' :
				{
					
					{
						JToolBarHelper::deleteList ( JText::_ ( 'The subscription will be dropped' ), 'drop', JText::_ ( 'Delete' ) );
						JToolBarHelper::cancel ();
					}
				
				}
				break;
			case 'addform' :
				{
					
					JToolBarHelper::save ();
					JToolBarHelper::cancel ( 'cancel', JText::_ ( 'Close' ) );
				}
				break;
			default :
				{
					
					JToolBarHelper::deleteList ( JText::_ ( 'Warning! The selected row(s) will be permanently deleted. Do you want to continue?' ) );
					JToolBarHelper::editList ( 'edit', 'View' );
					JToolBarHelper::addNewX ();
				}
		}
	
	}
	
	function JASubcriptions() {
		$task = JRequest::getWord ( 'task', '' );
		$document = & JFactory::getDocument ();
		$document->setTitle ( JText::_ ( 'Subcriptions & Permission Manager' ) );
		switch (strtolower ( $task )) {
			case 'add' :
				{
					$text = JText::_ ( 'NEW' );
					JToolBarHelper::title ( JText::_ ( 'SUBSCRIPTION' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::save ( 'save' );
					if ($edit)
						JToolBarHelper::cancel ( 'cancel', 'Close' );
					else
						JToolBarHelper::cancel ();
				}
				break;
			case 'edit' :
				{
					$text = JText::_ ( 'EDIT' );
					JToolBarHelper::title ( JText::_ ( 'SUBSCRIPTION' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				}
				break;
			
			default :
				{
					JToolBarHelper::title ( JText::_ ( 'Subscription Manager' ), 'generic.png' );
					//				JToolBarHelper::makeDefault();
					JToolBarHelper::publishList ();
					JToolBarHelper::unpublishList ();
					//				JToolBarHelper::custom('approved','archive','','approved');
					//				JToolBarHelper::custom('unapproved','unarchive','','unapproved');
					//				JToolBarHelper::deleteList();
					JToolBarHelper::editListX ();
					//				JToolBarHelper::addNewX();
				}
		}
	}
	
	function JACredits() {
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'add' :
				{
					$text = JText::_ ( 'NEW' );
					JToolBarHelper::title ( JText::_ ( 'CREDITS' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::save ( 'save' );
					JToolBarHelper::cancel ();
				
				}
				break;
			case 'edit' :
				{
					$text = JText::_ ( 'EDIT' );
					JToolBarHelper::title ( JText::_ ( 'CREDITS' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			default :
				{
					$document = & JFactory::getDocument ();
					$document->setTitle ( JText::_ ( 'Credit Manager' ) );
					
					JToolBarHelper::title ( JText::_ ( 'Credit Manager' ), 'generic.png' );
					JToolBarHelper::publishList ();
					JToolBarHelper::unpublishList ();
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete?' ) );
					JToolBarHelper::editListX ();
					JToolBarHelper::addNewX ();
				}
		}
	}
	
	function JACoupon() {
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'add' :
				{
					$text = JText::_ ( 'NEW' );
					JToolBarHelper::title ( JText::_ ( 'Coupon' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::save ( 'save' );
					JToolBarHelper::cancel ();
				
				}
				break;
			case 'edit' :
				{
					$text = JText::_ ( 'EDIT' );
					JToolBarHelper::title ( JText::_ ( 'Coupon' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			default :
				{
					$document = & JFactory::getDocument ();
					$document->setTitle ( JText::_ ( 'Coupon Manager' ) );
					
					JToolBarHelper::title ( JText::_ ( 'Coupon Manager' ), 'generic.png' );
					JToolBarHelper::addNewX ();
					JToolBarHelper::editListX ();
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete?' ) );
					JToolBarHelper::publishList ();
					JToolBarHelper::unpublishList ();
				}
		}
	}
	
	function JATax() {
		$task = JRequest::getWord ( 'task', '' );
		$tab = JRequest::getWord ( 'tab', 'global' );
		
		switch (strtolower ( $tab )) {
			
			case "global":
				JToolBarHelper::save ();
				break;
			case "region":
				switch (strtolower ( $task )) {
					case 'add' :
						{
							$text = JText::_ ( 'NEW' );
							JToolBarHelper::title ( JText::_ ( 'Regional TAX Manager' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
							JToolBarHelper::save ( 'save' );
							JToolBarHelper::cancel ();						
						}
						break;
					case 'edit' :
						{
							$text = JText::_ ( 'EDIT' );
							JToolBarHelper::title ( JText::_ ( 'Regional TAX Manager' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
							JToolBarHelper::apply ();
							JToolBarHelper::save ();
							JToolBarHelper::cancel ();
						
						}
						break;
					default :
						{
							$document = & JFactory::getDocument ();
							$document->setTitle ( JText::_ ( 'Regional TAX Manager' ) );
							
							JToolBarHelper::title ( JText::_ ( 'Regional TAX Manager' ), 'generic.png' );
							JToolBarHelper::addNewX ();
							JToolBarHelper::editListX ();
							JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete?' ) );
							JToolBarHelper::publishList ();
							JToolBarHelper::unpublishList ();
						}
				}
				break;
		}
	}
	
	function JAPostingPlans() {
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'add' :
				{
					$text = JText::_ ( 'NEW' );
					JToolBarHelper::title ( JText::_ ( 'POSTING PLANS' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::apply ();
					JToolBarHelper::save ( 'save' );
					JToolBarHelper::cancel ();
				
				}
				break;
			case 'edit' :
				{
					$text = JText::_ ( 'EDIT' );
					JToolBarHelper::title ( JText::_ ( 'POSTING PLANS' ) . ': <small><small>[ ' . $text . ' ]</small></small>', 'generic.png' );
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			default :
				{
					$document = & JFactory::getDocument ();
					$document->setTitle ( JText::_ ( 'Posting Plan Manager' ) );
					
					JToolBarHelper::title ( JText::_ ( 'Posting Plan Manager' ), 'generic.png' );
					JToolBarHelper::publishList ();
					JToolBarHelper::unpublishList ();
					JToolBarHelper::deleteList ( JText::_ ( 'Are you sure to delete?' ) );
					JToolBarHelper::editListX ();
					JToolBarHelper::addNewX ();
				}
		}
	}
	
	function JAPermission() {
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'edit' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			case 'bygroup' :
				{
					JToolBarHelper::save ( 'save_group' );
				}
				break;
		
		}
	}
	
	//	function JATransactions(){
	//		$document = & JFactory::getDocument();
	//		JToolBarHelper::title(JText::_('JA Job Board').'::'.JText::_('Transactions'), 'generic.png');
	//		$task = JRequest::getWord('task', '');
	//		switch (strtolower($task)){			
	//			case 'view_trans':
	//			case 'print_invoice':{
	//				$document->setTitle( JText::_('INVOICE') );
	//				JToolBarHelper::title( JText::_( 'VIEW INVOICE' ), 'generic.png' );
	//				JToolBarHelper::custom('convert_pdf','restore','','Convert PDF',false);
	//				JToolBarHelper::cancel();
	//				
	//			}break;
	//			default:{	
	//				
	//				$document->setTitle( JText::_('TRANSACTION SYSTEM') );			
	//				JToolBarHelper::customX('view_trans','preview','','View transactions');
	//				$userid = JRequest::getVar("userid",null);
	//				
	//				if($userid)
	//					JToolBarHelper::customX('back_profile','cancel','',JText::_("CANCEL"),false);
	//				
	//			}
	//		}
	//	}
	

	function JACustomtmpl() {
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'Custom Template' ) );
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'edit' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			default :
				{
				}
		}
	}
	
	function JAFinance() {
		$document = & JFactory::getDocument ();
		$document->setTitle ( JText::_ ( 'DEPOSITS MANAGER' ) );
		JToolBarHelper::title ( JText::_ ( 'JA Job Board' ) . '::' . JText::_ ( 'DEPOSITS MANAGER' ), 'generic.png' );
		
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'depositsetup' :
				{
					JToolBarHelper::unpublishList ( 'unpublishstetup' );
					JToolBarHelper::publish ( 'publishstetup' );
					JToolBarHelper::editList ();
					JToolBarHelper::addNewX ();
					JToolBarHelper::deleteListX ( JText::_ ( 'Are you sure to delete them?' ) );
				
				}
				break;
			case 'edit' :
				{
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				}
				break;
		}
	}
	
	function JALanguage() {
		$document = & JFactory::getDocument ();
		$document->setTitle ( JText::_ ( 'Language Manager' ) );
		JToolBarHelper::title ( JText::_ ( 'Language Manager' ), 'generic.png' );
		
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
			case 'edit' :
				{
					JToolBarHelper::apply ();
					JToolBarHelper::save ();
					JToolBarHelper::cancel ();
				
				}
				break;
			default :
				JToolBarHelper::editList ();
		}
	}
	
	function JAImportUsers(){
	    $document = & JFactory::getDocument ();
		$document->setTitle ( JText::_ ( 'Import Joomla Users' ) );
		JToolBarHelper::title ( JText::_ ( 'Import Joomla Users' ), 'generic.png' );
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
    		default :
    		    JToolBarHelper::custom( 'import_jobseeker', 'upload', '', JText::_ ( 'Import as JobSeeker' ), false );
    		    JToolBarHelper::custom( 'import_employer', 'upload', '', JText::_ ( 'Import as Employer' ), false );
    	}
	}
			
	function JAImportJoomSocialUsers(){
	    $document = & JFactory::getDocument ();
		$document->setTitle ( JText::_ ( 'Import JoomSocial Users' ) );
		JToolBarHelper::title ( JText::_ ( 'Import JoomSocial Users' ), 'generic.png' );
		$task = JRequest::getWord ( 'task', '' );
		switch (strtolower ( $task )) {
    		default :
    		    JToolBarHelper::custom( 'import_jobseeker', 'upload', '', JText::_ ( 'Import as JobSeeker' ), false );
    		    JToolBarHelper::custom( 'import_employer', 'upload', '', JText::_ ( 'Import as Employer' ), false );
    	}
	}
	
	function JAXML_IMPORT() {
		$document = & JFactory::getDocument ();
		$document->setTitle ( JText::_ ( 'XML Import Data Manager' ) );
		JToolBarHelper::title ( JText::_ ( 'XML Import Data Manager' ), 'generic.png' );
		$tab = JRequest::getVar ( "tab", "feeds" );
		$task = JRequest::getWord ( 'task', '' );
		switch ($tab) {
			case "feeds" :
				{
					switch (strtolower ( $task )) {
						case "edit" :
						case "add" :
							{
								JToolBarHelper::save ();
								JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
							}
							break;
						
						case "setupstruct" :
							JToolBarHelper::save ( "savestruct" );
							JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
							break;
						
						case "setupfield" :
							JToolBarHelper::save ( "savefield");
							JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
							break;
						
						case "importdata" :
							JToolBarHelper::save ( "saveimport");
							JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
							break;
						
						default :
							JToolBarHelper::addNew();
							JToolBarHelper::editListX ( "edit", JText::_ ( "Edit" ) );
							JToolBarHelper::deleteListX ( JText::_ ( "Are you sure to delete them?" ), "remove", "Delete" );
					}
				}
				break;
			
			case "imported" :
				{
					JToolBarHelper::customX ( 'approved', 'publish', '', 'Approve', true );
					JToolBarHelper::customX ( 'non-approved', 'unpublish', '', 'Disapprove', true );
					JToolBarHelper::editListX ( "edit", JText::_ ( "Edit" ) );
					JToolBarHelper::deleteListX ( JText::_ ( "Are you sure to delete them?" ), "remove", "Delete" );
					break;
				}
		}
	}
	
	function JAXML_EXPORT() {
	$document = & JFactory::getDocument ();
		$document->setTitle ( JText::_ ( 'XML Export Data Manager' ) );
		JToolBarHelper::title ( JText::_ ( 'XML Export Data Manager' ), 'generic.png' );
		$tab = JRequest::getVar ( "tab", "feeds" );
		$task = JRequest::getWord ( 'task', '' );
		switch ($tab) {
			case "feeds" :
				{
					switch (strtolower ( $task )) {
						case "add" :
						case "edit" :
							{
								JToolBarHelper::save ();
								JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
							}
							break;
						
						case "setupstruct" :
							JToolBarHelper::save ( "savestruct" );
							JToolBarHelper::cancel ( 'cancel', 'Close' );
							break;
						
						case "setupfield" :
							JToolBarHelper::save ( "savefield");
							JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
							break;
						
						case "importdata" :
							JToolBarHelper::save ( "saveimport" );
							JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
							break;
						
						default :
							JToolBarHelper::addNew();
							JToolBarHelper::editListX ( "edit", JText::_ ( "Edit" ) );
							JToolBarHelper::deleteListX ( JText::_ ( "Are you sure to delete them?" ), "remove", "Delete" );
					}
				}
				break;
			
			case "schemas" :
				{
					switch (strtolower ( $task )) {
						case "add" :
						case "edit" :
						{
							JToolBarHelper::save ();
							JToolBarHelper::cancel ( 'cancel', JText::_ ( "Close" ) );
						}
						break;
						case "configxml" :
							JToolBarHelper::cancel ( "cancel", JText::_ ( "Close" ) );
							break;
						
						default :
							JToolBarHelper::addNew();
							JToolBarHelper::editListX ( "edit", JText::_ ( "Edit" ) );
							JToolBarHelper::deleteListX ( JText::_ ( "Are you sure to delete them?" ), "remove", "Delete" );
					}
					
					break;
				}
		}
	}
}
?>